public class WhileDemo11 {
    public static void main(String[] args) {
        for (int i = 0; i < 100; i++) {
            System.out.println(i);
            if (i == 50) {
                break;// 停止循环
            }
        }

        int i = 0;
        while (i <= 100){
            System.out.println(i);
            if (i == 50){
                break;
            }
            i++;
        }
    }
}
